package com.homegoods.designer.app;

import android.app.Application;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentManager;

import com.homegoods.integration.AppLifecycles;
import com.homegoods.integration.ConfigModule;
import com.network.utils.NetworkUtils;
import com.umeng.commonsdk.UMConfigure;

import java.util.List;

/**
 * @author QiQi
 * @ClassName: GlobalConfiguration
 * @date 2018/9/22
 * @description
 */
public class GlobalConfiguration implements ConfigModule {
    @Override
    public void applyOptions(Context context) {

    }

    @Override
    public void injectAppLifecycle(Context context, List<AppLifecycles> lifecycles) {
        lifecycles.add(new AppLifecycles() {
            @Override
            public void attachBaseContext(@NonNull Context base) {

            }

            @Override
            public void onCreate(@NonNull Application application) {
                UMConfigure.init(application, "59a9f6e14544cb7232000c25", null, UMConfigure.DEVICE_TYPE_PHONE, "");
                NetworkUtils.init(application);
            }

            @Override
            public void onTerminate(@NonNull Application application) {

            }
        });
    }

    @Override
    public void injectActivityLifecycle(Context context, List<Application.ActivityLifecycleCallbacks> lifecycles) {

    }

    @Override
    public void injectFragmentLifecycle(Context context, List<FragmentManager.FragmentLifecycleCallbacks> lifecycles) {

    }
}
